<?php$connect = mysql_connect('localhost','root','');mysql_select_db("ajax_form");?><?php$id = $_GET['id'];$delete = "DELETE from user where userid='$id'";$dq = mysql_query($delete);if(isset($_POST['formsubmit'])){//print_r($_POST);$firstname  = $_POST['firstname'];$insert = "INSERT into user(firstname) VALUES('$firstname')";$insertquery = mysql_query($insert);}?><?php$select = "SELECT * from user";$sq = mysql_query($select);?><table border="1" cellspacing="0"><tr><td>Firstname</td><td><a href="javascript:void(0)" id="add">ADD</a></td><td></td></tr><?phpwhile($row = mysql_fetch_array($sq)){?><tr><td><?phpecho $row['firstname'];?></td><td><a href="javascript:void(0)" class="<?php echo $row['userid'];?>" id="edit">Edit</a><a href="javascript:void(0)" class="<?php echo $row['userid'];?>" id="delete">DELETE</a></td></tr><?php} ?></table>